package com.du.cloud.security.service;

import lombok.Getter;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;

/**
 * Desc: 扩展用户信息
 * Author: dushuang
 * Date: 2020/5/25
 **/
public class TokenUser extends User {
    /**
     * 用户ID
     */
    @Getter
    private Integer id;
    @Getter
    private String phone;

    public TokenUser(Integer id,
                     String phone,
                     String username,
                     String password,
                     boolean enabled,
                     Collection<? extends GrantedAuthority> authorities) {
        super(username, password, enabled, true, true, true, authorities);
        this.id = id;
        this.phone = phone;
    }

}
